//
//  BaseViewController.m
//  WuJieLive
//
//  Created by iMac on 2017/10/13.
//  Copyright © 2017年 zhk. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

-(UIButton *)leftBtn
{
    if (!_leftBtn) {
        _leftBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _leftBtn.frame = CGRectMake(0, 0, 44, 44);
        _leftBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
        _leftBtn.backgroundColor = [UIColor clearColor];
        [_leftBtn setImage:[[UIImage imageNamed:@"icon_nav_返回"] imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)] forState:(UIControlStateNormal)];
        [_leftBtn addTarget:self action:@selector(leftBtnAction:) forControlEvents:(UIControlEventTouchUpInside)];
    }
    return _leftBtn;
}

- (UIButton *)rightBtn
{
    if (!_rightBtn) {
        _rightBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _rightBtn.frame = CGRectMake(0, 0, 44, 44);
        _rightBtn.backgroundColor = [UIColor clearColor];
        _rightBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -20);
        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:_rightBtn];
        _rightBtn.titleLabel.font = FontSize(15);
        [_rightBtn setTitleColor:TextAssistColor forState:(UIControlStateNormal)];
        [_rightBtn addTarget:self action:@selector(rightBtnAction:) forControlEvents:(UIControlEventTouchUpInside)];
    }
    return _rightBtn;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:self.leftBtn];
    self.navigationController.navigationBar.hidden = NO;
    self.edgesForExtendedLayout = UIRectEdgeNone; //  是表视图从导航条下开始布局显示
//    [self.tabBarController.tabBar setBackgroundImage:[UIImage new]];
//    [self.tabBarController.tabBar setShadowImage:[UIImage new]];
//    UIRectEdgeTop
    [self setNavi];
    [self setData];
    [self setUI];
}


- (void)viewDidAppear:(BOOL)animated {
    
    [super viewDidAppear:animated];
    
    self.hidesBottomBarWhenPushed=YES;
    
}

- (void)setNavi
{
    
}

- (void)setUI{
    
}

- (void)setData{
    
}

- (void)leftBtnAction:(UIButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)rightBtnAction:(UIButton *)sender
{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
